<template>
  <el-card>
    <el-row>
      <el-col :span="12">
        <el-button :disabled="disabled"
                   @click="handleQuotationTest">测试</el-button>
      </el-col>
    </el-row>
  </el-card>
</template>

<script>
import { QuotationValidator } from '@/components/table/validator'
export default {
  name: "TableValidatorTests",
  data () {
    return { disabled: false }
  },
  methods: {
    async handleQuotationTest () {
      this.disabled = true;
      const timer = setTimeout(() => {
        this.disabled = false;
        clearTimeout(timer);
      }, 2000)
      const validator = new QuotationValidator();
      const ok = await validator.validate({ subjectId: 1 }, this);
      this.disabled = false;
      this.$message({ type: "success", message: "验证通过，执行报价操作" })
    },
    search () {
      this.$message({ message: '刷新表格' });
    }
  }
}
</script>